//
//  MainVC.m
//  OCRunnerIntegradeDemo
//
//  Created by yryc on 2025/2/17.
//

#import "MainVC.h"
#import "AddNewVC.h"
#import "LoadWebVC.h"
#import "ChangeObjectVC.h"
#import "ChangeMethodVC.h"
#import "LoadDataFromNetVC.h"
@interface MainVC ()

@end

@implementation MainVC


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.whiteColor;
    self.navigationItem.title = @"热更菜单页面2";
    self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    NSArray *titles = @[@"替换某个类的方法",@"添加新页面",@"修改某个类的方法中的某个对象的属性",@"ssss"];
    for (int i = 0; i < titles.count; i++) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.frame = CGRectMake((self.view.frame.size.width - 280) / 2, 120 + i * 80, 280, 60);
        button.titleLabel.font = [UIFont systemFontOfSize:15];
        [button setTitle:titles[i] forState:UIControlStateNormal];
        button.backgroundColor = UIColor.cyanColor;
        [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:button];
    }
    
    
}

#pragma mark - buttonActions
- (void)buttonAction:(UIButton *)button {
    NSLog(@"ddd");
    
    if ([@"替换某个类的方法" isEqual:button.titleLabel.text]) {
        ChangeMethodVC *VC = [[ChangeMethodVC alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
        return;
    }
    
    if ([@"添加新页面" isEqual:button.titleLabel.text]) {
        LoadWebVC *VC = [[LoadWebVC alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
        return;
    }
    
    if ([@"修改某个类的方法中的某个对象的属性" isEqual:button.titleLabel.text]) {
        ChangeObjectVC *VC = [[ChangeObjectVC alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
        return;
    }  
    if ([@"ssss" isEqual:button.titleLabel.text]) {
        LoadDataFromNetVC *VC = [[LoadDataFromNetVC alloc] init];
        [self.navigationController pushViewController:VC animated:YES];
        return;
    }
}

- (void)ttttt {
    NSLog(@"tttt2333");
}

@end
